{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (1) Load Datasets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(477, 11)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'13</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2785</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'16</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>3133</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'09</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>3901</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'21</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>4946</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3'44</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13</td>\n",
       "      <td>9</td>\n",
       "      <td>3538</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别 男1000米跑  男50米跑    男跳远  男体前屈  男引体  男肺活量     身高    体重   BMI\n",
       "0   1  男    4'13   8.88  195.0    12    1  2785  170.0  72.6  25.1\n",
       "1   1  男    4'16   7.70  225.0    11    7  3133  174.0  52.7  17.4\n",
       "2   1  男    4'09   8.45  218.0    14    1  3901  169.0  46.5  16.3\n",
       "3   1  男    4'21   8.05  206.0    13    1  4946  183.0  79.7  23.8\n",
       "4   1  男    3'44   7.52  210.0    13    9  3538  171.0  54.7  18.7"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 477 entries, 0 to 476\n",
      "Data columns (total 11 columns):\n",
      " #   Column   Non-Null Count  Dtype  \n",
      "---  ------   --------------  -----  \n",
      " 0   班级       477 non-null    int64  \n",
      " 1   性别       477 non-null    object \n",
      " 2   男1000米跑  477 non-null    object \n",
      " 3   男50米跑    477 non-null    float64\n",
      " 4   男跳远      477 non-null    float64\n",
      " 5   男体前屈     477 non-null    int64  \n",
      " 6   男引体      477 non-null    int64  \n",
      " 7   男肺活量     477 non-null    int64  \n",
      " 8   身高       477 non-null    float64\n",
      " 9   体重       477 non-null    float64\n",
      " 10  BMI      466 non-null    float64\n",
      "dtypes: float64(5), int64(4), object(2)\n",
      "memory usage: 41.1+ KB\n",
      "(593, 11)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重   BMI\n",
       "0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3  19.3\n",
       "1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6  25.1\n",
       "2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0  24.3\n",
       "3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7  19.8\n",
       "4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9  22.9"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 593 entries, 0 to 592\n",
      "Data columns (total 11 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   班级      593 non-null    int64  \n",
      " 1   性别      593 non-null    object \n",
      " 2   女800米跑  593 non-null    float64\n",
      " 3   女50米跑   593 non-null    float64\n",
      " 4   女跳远     593 non-null    float64\n",
      " 5   女体前屈    593 non-null    int64  \n",
      " 6   女仰卧     593 non-null    int64  \n",
      " 7   女肺活量    593 non-null    int64  \n",
      " 8   身高      593 non-null    float64\n",
      " 9   体重      593 non-null    float64\n",
      " 10  BMI     586 non-null    float64\n",
      "dtypes: float64(6), int64(4), object(1)\n",
      "memory usage: 51.1+ KB\n",
      "(20, 24)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>100</td>\n",
       "      <td>3'24\"</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3'35\"</td>\n",
       "      <td>95</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3'40\"</td>\n",
       "      <td>90</td>\n",
       "      <td>3'36\"</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3'47\"</td>\n",
       "      <td>85</td>\n",
       "      <td>3'43\"</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>80</td>\n",
       "      <td>3'50\"</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远        男引体  \\\n",
       "     成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数    成绩   \n",
       "0  4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100  16.0   \n",
       "1  4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95  15.0   \n",
       "2  4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90  14.0   \n",
       "3  4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85  13.0   \n",
       "4  3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80  12.0   \n",
       "\n",
       "       女仰卧      男1000米跑      女800米跑       \n",
       "    分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0  100  53  100   3'30\"  100  3'24\"  100  \n",
       "1   95  51   95   3'35\"   95  3'30\"   95  \n",
       "2   90  49   90   3'40\"   90  3'36\"   90  \n",
       "3   85  46   85   3'47\"   85  3'43\"   85  \n",
       "4   80  43   80   3'55\"   80  3'50\"   80  \n",
       "\n",
       "[5 rows x 24 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 20 entries, 0 to 19\n",
      "Data columns (total 24 columns):\n",
      " #   Column         Non-Null Count  Dtype  \n",
      "---  ------         --------------  -----  \n",
      " 0   (男肺活量, 成绩)     20 non-null     int64  \n",
      " 1   (男肺活量, 分数)     20 non-null     int64  \n",
      " 2   (女肺活量, 成绩)     20 non-null     int64  \n",
      " 3   (女肺活量, 分数)     20 non-null     int64  \n",
      " 4   (男50米跑, 成绩)    20 non-null     float64\n",
      " 5   (男50米跑, 分数)    20 non-null     int64  \n",
      " 6   (女50米跑, 成绩)    20 non-null     float64\n",
      " 7   (女50米跑, 分数)    20 non-null     int64  \n",
      " 8   (男体前屈, 成绩)     20 non-null     float64\n",
      " 9   (男体前屈, 分数)     20 non-null     int64  \n",
      " 10  (女体前屈, 成绩)     20 non-null     float64\n",
      " 11  (女体前屈, 分数)     20 non-null     int64  \n",
      " 12  (男跳远, 成绩)      20 non-null     int64  \n",
      " 13  (男跳远, 分数)      20 non-null     int64  \n",
      " 14  (女跳远, 成绩)      20 non-null     int64  \n",
      " 15  (女跳远, 分数)      20 non-null     int64  \n",
      " 16  (男引体, 成绩)      15 non-null     float64\n",
      " 17  (男引体, 分数)      20 non-null     int64  \n",
      " 18  (女仰卧, 成绩)      20 non-null     int64  \n",
      " 19  (女仰卧, 分数)      20 non-null     int64  \n",
      " 20  (男1000米跑, 成绩)  20 non-null     object \n",
      " 21  (男1000米跑, 分数)  20 non-null     int64  \n",
      " 22  (女800米跑, 成绩)   20 non-null     object \n",
      " 23  (女800米跑, 分数)   20 non-null     int64  \n",
      "dtypes: float64(5), int64(17), object(2)\n",
      "memory usage: 3.9+ KB\n"
     ]
    }
   ],
   "source": [
    "grades_male = pd.read_excel('18级高一体测成绩汇总.xls')\n",
    "grades_female = pd.read_excel('18级高一体测成绩汇总.xls', sheet_name=1)\n",
    "grades_standard = pd.read_excel('体侧成绩评分表.xls', header=[0,1])\n",
    "\n",
    "for frame in [grades_male, grades_female, grades_standard]:\n",
    "    if 'BMI' in frame.columns:\n",
    "        frame['BMI'] = (frame['体重'] / ((frame['身高'] / 100) ** 2)).round(1)\n",
    "        \n",
    "    print(frame.shape)\n",
    "    frame.head()\n",
    "    frame.info()\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (2) Data Types Transform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "grades_male['男1000米跑'] = grades_male['男1000米跑'].apply(lambda x: float(str(x).replace(\"'\", \".\")))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 20 entries, 0 to 19\n",
      "Data columns (total 24 columns):\n",
      " #   Column         Non-Null Count  Dtype  \n",
      "---  ------         --------------  -----  \n",
      " 0   (男肺活量, 成绩)     20 non-null     int64  \n",
      " 1   (男肺活量, 分数)     20 non-null     int64  \n",
      " 2   (女肺活量, 成绩)     20 non-null     int64  \n",
      " 3   (女肺活量, 分数)     20 non-null     int64  \n",
      " 4   (男50米跑, 成绩)    20 non-null     float64\n",
      " 5   (男50米跑, 分数)    20 non-null     int64  \n",
      " 6   (女50米跑, 成绩)    20 non-null     float64\n",
      " 7   (女50米跑, 分数)    20 non-null     int64  \n",
      " 8   (男体前屈, 成绩)     20 non-null     float64\n",
      " 9   (男体前屈, 分数)     20 non-null     int64  \n",
      " 10  (女体前屈, 成绩)     20 non-null     float64\n",
      " 11  (女体前屈, 分数)     20 non-null     int64  \n",
      " 12  (男跳远, 成绩)      20 non-null     int64  \n",
      " 13  (男跳远, 分数)      20 non-null     int64  \n",
      " 14  (女跳远, 成绩)      20 non-null     int64  \n",
      " 15  (女跳远, 分数)      20 non-null     int64  \n",
      " 16  (男引体, 成绩)      15 non-null     float64\n",
      " 17  (男引体, 分数)      20 non-null     int64  \n",
      " 18  (女仰卧, 成绩)      20 non-null     int64  \n",
      " 19  (女仰卧, 分数)      20 non-null     int64  \n",
      " 20  (男1000米跑, 成绩)  20 non-null     float64\n",
      " 21  (男1000米跑, 分数)  20 non-null     int64  \n",
      " 22  (女800米跑, 成绩)   20 non-null     float64\n",
      " 23  (女800米跑, 分数)   20 non-null     int64  \n",
      "dtypes: float64(7), int64(17)\n",
      "memory usage: 3.9 KB\n"
     ]
    }
   ],
   "source": [
    "grades_standard['男1000米跑', '成绩'] = grades_standard['男1000米跑', '成绩'].apply(lambda x: float(str(x).replace(\"'\", \".\").replace('\"', '')))\n",
    "grades_standard['女800米跑', '成绩'] = grades_standard['女800米跑', '成绩'].apply(lambda x: float(str(x).replace(\"'\", \".\").replace('\"', '')))\n",
    "grades_standard.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### (3) Mapping function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def score_mapping(col, x):\n",
    "    res = list()\n",
    "    for i, j in grades_standard[col].values:\n",
    "        if '跑' in col:\n",
    "            if i >= x:\n",
    "                res.append(j)\n",
    "        else:\n",
    "            if i <= x:\n",
    "                res.append(j)\n",
    "                \n",
    "    if len(res) == 0:\n",
    "        res = [0]\n",
    "\n",
    "    return res[0]\n",
    "    \n",
    "    \n",
    "score_mapping('女50米跑', 7.14)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "sports = np.unique([col[0] for col in grades_standard.columns.tolist() if ('男' in col[0]) or ('女' in col[0])])\n",
    "for col in sports:\n",
    "    if '女' in col:\n",
    "        grades_female[f'{col}成绩'] = grades_female[col].apply(lambda x: score_mapping(col, x))\n",
    "    else:\n",
    "        grades_male[f'{col}成绩'] = grades_male[col].apply(lambda x: score_mapping(col, x))\n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 排序好讀一些\n",
    "\n",
    "grades_female = grades_female[['班级','性别','身高','体重','BMI'] + np.sort([col for col in grades_female.columns.tolist() if '女' in col]).tolist()]\n",
    "grades_male = grades_male[['班级','性别','身高','体重','BMI'] + np.sort([col for col in grades_male.columns.tolist() if '男' in col]).tolist()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女体前屈成绩</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女跳远成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3</td>\n",
       "      <td>9.32</td>\n",
       "      <td>72.0</td>\n",
       "      <td>3.22</td>\n",
       "      <td>100.0</td>\n",
       "      <td>48</td>\n",
       "      <td>85</td>\n",
       "      <td>16</td>\n",
       "      <td>76.0</td>\n",
       "      <td>3775</td>\n",
       "      <td>100</td>\n",
       "      <td>185.0</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.1</td>\n",
       "      <td>11.44</td>\n",
       "      <td>10.0</td>\n",
       "      <td>4.59</td>\n",
       "      <td>40.0</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>9</td>\n",
       "      <td>66.0</td>\n",
       "      <td>3683</td>\n",
       "      <td>100</td>\n",
       "      <td>148.0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>24.3</td>\n",
       "      <td>13.40</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.46</td>\n",
       "      <td>80.0</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>7</td>\n",
       "      <td>64.0</td>\n",
       "      <td>3331</td>\n",
       "      <td>100</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8</td>\n",
       "      <td>9.52</td>\n",
       "      <td>70.0</td>\n",
       "      <td>3.39</td>\n",
       "      <td>85.0</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>21</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3701</td>\n",
       "      <td>100</td>\n",
       "      <td>172.0</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9</td>\n",
       "      <td>9.79</td>\n",
       "      <td>68.0</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85.0</td>\n",
       "      <td>34</td>\n",
       "      <td>70</td>\n",
       "      <td>8</td>\n",
       "      <td>64.0</td>\n",
       "      <td>3592</td>\n",
       "      <td>100</td>\n",
       "      <td>145.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>19.6</td>\n",
       "      <td>9.60</td>\n",
       "      <td>70.0</td>\n",
       "      <td>3.51</td>\n",
       "      <td>78.0</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>24</td>\n",
       "      <td>95.0</td>\n",
       "      <td>2255</td>\n",
       "      <td>70</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>21.5</td>\n",
       "      <td>10.18</td>\n",
       "      <td>64.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>76.0</td>\n",
       "      <td>36</td>\n",
       "      <td>72</td>\n",
       "      <td>13</td>\n",
       "      <td>72.0</td>\n",
       "      <td>2937</td>\n",
       "      <td>85</td>\n",
       "      <td>150.0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>17.9</td>\n",
       "      <td>10.18</td>\n",
       "      <td>64.0</td>\n",
       "      <td>3.45</td>\n",
       "      <td>80.0</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>15</td>\n",
       "      <td>76.0</td>\n",
       "      <td>2592</td>\n",
       "      <td>76</td>\n",
       "      <td>152.0</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>18.4</td>\n",
       "      <td>9.67</td>\n",
       "      <td>68.0</td>\n",
       "      <td>4.01</td>\n",
       "      <td>74.0</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>10</td>\n",
       "      <td>68.0</td>\n",
       "      <td>1829</td>\n",
       "      <td>60</td>\n",
       "      <td>165.0</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>21.1</td>\n",
       "      <td>9.09</td>\n",
       "      <td>74.0</td>\n",
       "      <td>4.48</td>\n",
       "      <td>50.0</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>10</td>\n",
       "      <td>68.0</td>\n",
       "      <td>2962</td>\n",
       "      <td>85</td>\n",
       "      <td>180.0</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别     身高    体重   BMI  女50米跑  女50米跑成绩  女800米跑  女800米跑成绩  女仰卧  女仰卧成绩  \\\n",
       "0     1  女  163.0  51.3  19.3   9.32     72.0    3.22     100.0   48     85   \n",
       "1     1  女  163.0  66.6  25.1  11.44     10.0    4.59      40.0   29     66   \n",
       "2     1  女  157.0  60.0  24.3  13.40      0.0    3.46      80.0   40     76   \n",
       "3     1  女  160.0  50.7  19.8   9.52     70.0    3.39      85.0   46     85   \n",
       "4     1  女  167.0  63.9  22.9   9.79     68.0    3.43      85.0   34     70   \n",
       "..   .. ..    ...   ...   ...    ...      ...     ...       ...  ...    ...   \n",
       "588  17  女  158.0  49.0  19.6   9.60     70.0    3.51      78.0   41     78   \n",
       "589  17  女  161.0  55.7  21.5  10.18     64.0    4.00      76.0   36     72   \n",
       "590  17  女  165.0  48.6  17.9  10.18     64.0    3.45      80.0   35     72   \n",
       "591  17  女  154.0  43.6  18.4   9.67     68.0    4.01      74.0   41     78   \n",
       "592  17  女  162.0  55.3  21.1   9.09     74.0    4.48      50.0   46     85   \n",
       "\n",
       "     女体前屈  女体前屈成绩  女肺活量  女肺活量成绩    女跳远  女跳远成绩  \n",
       "0      16    76.0  3775     100  185.0     85  \n",
       "1       9    66.0  3683     100  148.0     60  \n",
       "2       7    64.0  3331     100  150.0     60  \n",
       "3      21    90.0  3701     100  172.0     76  \n",
       "4       8    64.0  3592     100  145.0     50  \n",
       "..    ...     ...   ...     ...    ...    ...  \n",
       "588    24    95.0  2255      70  150.0     60  \n",
       "589    13    72.0  2937      85  150.0     60  \n",
       "590    15    76.0  2592      76  152.0     62  \n",
       "591    10    68.0  1829      60  165.0     70  \n",
       "592    10    68.0  2962      85  180.0     80  \n",
       "\n",
       "[593 rows x 17 columns]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grades_female"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>男肺活量成绩</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男跳远成绩</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1</td>\n",
       "      <td>4.13</td>\n",
       "      <td>72.0</td>\n",
       "      <td>8.88</td>\n",
       "      <td>66.0</td>\n",
       "      <td>12</td>\n",
       "      <td>74.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2785</td>\n",
       "      <td>62</td>\n",
       "      <td>195.0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4</td>\n",
       "      <td>4.16</td>\n",
       "      <td>70.0</td>\n",
       "      <td>7.70</td>\n",
       "      <td>78.0</td>\n",
       "      <td>11</td>\n",
       "      <td>74.0</td>\n",
       "      <td>7</td>\n",
       "      <td>60.0</td>\n",
       "      <td>3133</td>\n",
       "      <td>68</td>\n",
       "      <td>225.0</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.3</td>\n",
       "      <td>4.09</td>\n",
       "      <td>74.0</td>\n",
       "      <td>8.45</td>\n",
       "      <td>70.0</td>\n",
       "      <td>14</td>\n",
       "      <td>78.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3901</td>\n",
       "      <td>80</td>\n",
       "      <td>218.0</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.8</td>\n",
       "      <td>4.21</td>\n",
       "      <td>68.0</td>\n",
       "      <td>8.05</td>\n",
       "      <td>74.0</td>\n",
       "      <td>13</td>\n",
       "      <td>76.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4946</td>\n",
       "      <td>100</td>\n",
       "      <td>206.0</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7</td>\n",
       "      <td>3.44</td>\n",
       "      <td>85.0</td>\n",
       "      <td>7.52</td>\n",
       "      <td>78.0</td>\n",
       "      <td>13</td>\n",
       "      <td>76.0</td>\n",
       "      <td>9</td>\n",
       "      <td>68.0</td>\n",
       "      <td>3538</td>\n",
       "      <td>74</td>\n",
       "      <td>210.0</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.4</td>\n",
       "      <td>4.23</td>\n",
       "      <td>68.0</td>\n",
       "      <td>8.27</td>\n",
       "      <td>72.0</td>\n",
       "      <td>10</td>\n",
       "      <td>72.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4647</td>\n",
       "      <td>100</td>\n",
       "      <td>208.0</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>473</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>24.3</td>\n",
       "      <td>5.19</td>\n",
       "      <td>40.0</td>\n",
       "      <td>9.55</td>\n",
       "      <td>50.0</td>\n",
       "      <td>15</td>\n",
       "      <td>80.0</td>\n",
       "      <td>6</td>\n",
       "      <td>50.0</td>\n",
       "      <td>7042</td>\n",
       "      <td>100</td>\n",
       "      <td>210.0</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>19.8</td>\n",
       "      <td>3.25</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.50</td>\n",
       "      <td>80.0</td>\n",
       "      <td>13</td>\n",
       "      <td>76.0</td>\n",
       "      <td>13</td>\n",
       "      <td>85.0</td>\n",
       "      <td>5755</td>\n",
       "      <td>100</td>\n",
       "      <td>252.0</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.5</td>\n",
       "      <td>4.39</td>\n",
       "      <td>62.0</td>\n",
       "      <td>7.81</td>\n",
       "      <td>76.0</td>\n",
       "      <td>14</td>\n",
       "      <td>78.0</td>\n",
       "      <td>11</td>\n",
       "      <td>76.0</td>\n",
       "      <td>5688</td>\n",
       "      <td>100</td>\n",
       "      <td>208.0</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.00</td>\n",
       "      <td>100.0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>100.0</td>\n",
       "      <td>0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别     身高    体重   BMI  男1000米跑  男1000米跑成绩  男50米跑  男50米跑成绩  男体前屈  \\\n",
       "0     1  男  170.0  72.6  25.1     4.13       72.0   8.88     66.0    12   \n",
       "1     1  男  174.0  52.7  17.4     4.16       70.0   7.70     78.0    11   \n",
       "2     1  男  169.0  46.5  16.3     4.09       74.0   8.45     70.0    14   \n",
       "3     1  男  183.0  79.7  23.8     4.21       68.0   8.05     74.0    13   \n",
       "4     1  男  171.0  54.7  18.7     3.44       85.0   7.52     78.0    13   \n",
       "..   .. ..    ...   ...   ...      ...        ...    ...      ...   ...   \n",
       "472  17  男  176.0  69.5  22.4     4.23       68.0   8.27     72.0    10   \n",
       "473  17  男  177.0  76.0  24.3     5.19       40.0   9.55     50.0    15   \n",
       "474  17  男  181.0  65.0  19.8     3.25      100.0   7.50     80.0    13   \n",
       "475  17  男  172.0  51.7  17.5     4.39       62.0   7.81     76.0    14   \n",
       "476  17  男    0.0   0.0   NaN     0.00      100.0   0.00    100.0     0   \n",
       "\n",
       "     男体前屈成绩  男引体  男引体成绩  男肺活量  男肺活量成绩    男跳远  男跳远成绩  \n",
       "0      74.0    1    0.0  2785      62  195.0     60  \n",
       "1      74.0    7   60.0  3133      68  225.0     74  \n",
       "2      78.0    1    0.0  3901      80  218.0     70  \n",
       "3      76.0    1    0.0  4946     100  206.0     64  \n",
       "4      76.0    9   68.0  3538      74  210.0     66  \n",
       "..      ...  ...    ...   ...     ...    ...    ...  \n",
       "472    72.0    0    0.0  4647     100  208.0     66  \n",
       "473    80.0    6   50.0  7042     100  210.0     66  \n",
       "474    76.0   13   85.0  5755     100  252.0     90  \n",
       "475    78.0   11   76.0  5688     100  208.0     66  \n",
       "476    50.0    0    0.0     0       0    0.0      0  \n",
       "\n",
       "[477 rows x 17 columns]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grades_male"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
